﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="Stylesheet" href="css/main.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Label ID="Label1" runat="server" style="font-size: xx-large" 
            Text="Welcome to the WebReversi"></asp:Label>
        <br />
        <br />
        <label class="login_form_label" for="txtUsername" >Username</label>
        <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
        <div class="validation">
            <asp:RequiredFieldValidator ID="RequiredFieldValidatorUsername" runat="server" 
                ControlToValidate="txtUsername" Display="Dynamic" 
                ErrorMessage="Please enter a username" SetFocusOnError="True" ForeColor="Red">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ControlToValidate="txtUsername" 
                ErrorMessage="Name must be between 4 and 12 characters, (only letters, numbers, and underscores)" 
                ForeColor="Red" ValidationExpression="[A-Za-z0-9_]{4,12}">
            </asp:RegularExpressionValidator>
        </div>
        <br />
        <label class="login_form_label" for="txtPassword" >Password</label>
        <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
        <div class="validation">
            <asp:RequiredFieldValidator ID="RequiredFieldValidatorPassword" runat="server" 
                ControlToValidate="txtPassword" Display="Dynamic" 
                ErrorMessage="Please enter a password">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidatorPassword" 
                runat="server" ControlToValidate="txtPassword" Display="Dynamic" 
                ErrorMessage="Password must be more than 6 characters with 1 special character" 
                ValidationExpression="^.*(?=.{6,})(?=.*[^A-Za-z0-9]).*$">
            </asp:RegularExpressionValidator>
        </div>
        <br />
        <label class="login_form_label" for="btnLogin" >&nbsp;</label>
        <asp:Button ID="btnLogin" runat="server" onclick="btnLogin_Click" Text="Login" CssClass="btn"/>
        <br />
        <label class="login_form_label" for="btnRegister" >&nbsp;</label>
        <asp:Button ID="btnRegister" runat="server" Text="Register" onclick="btnRegister_Click" CssClass="btn"/>
        <br />
        <asp:Label ID="lblLoginMessage" runat="server"></asp:Label>
        <br />
    
    </div>
    </form>
</body>
</html>
